package top.laoshuzi.mvp.module.main;

import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;

import top.laoshuzi.mvp.api.home.HomeModel;
import top.laoshuzi.mvp.api.main.MainModel;
import top.laoshuzi.mvp.api.main.MainPresenter;
import top.laoshuzi.mvp.api.main.MainView;
import top.laoshuzi.mvp.base.BasePresenter;

@Route(path = "/main/MainPresenter")
public class MainPresenterImpl extends BasePresenter<MainView> implements MainPresenter {

    @Autowired(name = "/main/MainModel")
    MainModel mainModel;

    @Override
    public Object injectObject() {
        return this;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.w("MainPresenter", "onCreate");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.w("MainPresenter", "onDestroy");
    }

    @Override
    public void init(Context context) {

    }

    @Override
    public void welcome() {
        Log.w("MainPresenter", "Welcome");
        mainModel.welcome();
        getView().onShowWelcome();
    }
}
